package cn.nebula.music.converter;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.convert.converter.Converter;
import org.springframework.stereotype.Component;

import cn.nebula.music.dao.SingerDAO;
import cn.nebula.music.domain.Singer;

@Component
public class StringToSingerConverter implements Converter<String,Singer>{

	@Autowired
	private SingerDAO singerDAO;

	@Override
	public Singer convert(String source) {
		return singerDAO.findSingerById(Integer.valueOf(source));
	}	
	
}
